import { CATEGORY_DARA } from '../actions/actionsTypes.js';

const initState = {
  items: []
}

const getCat = (state, action) => {
  return {...state, items: action.obj.items};
}

const categoryReducer = (state = initState, action) => {
  switch(action.type) {
    case CATEGORY_DARA:
      return getCat(state, action);
    default:
      return state;
  }
}

export default categoryReducer;
